<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link rel="stylesheet" href="layui-v2.5.7/layui/css/layui.css">
</head>

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">在线考试系统</div>
            <!-- 头部区域（可配合layui已有的水平导航） -->
            <!-- <ul class="layui-nav layui-layout-left">
          <li class="layui-nav-item"><a href="">控制台</a></li>
          <li class="layui-nav-item"><a href="">商品管理</a></li>
          <li class="layui-nav-item"><a href="">用户</a></li>
          <li class="layui-nav-item">
            <a href="javascript:;">其它系统</a>
            <dl class="layui-nav-child">
              <dd><a href="">邮件管理</a></dd>
              <dd><a href="">消息管理</a></dd>
              <dd><a href="">授权管理</a></dd>
            </dl>
          </li>
        </ul> -->
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="Test/Image/1.jpg" class="layui-nav-img">
                        <span id="user"></span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="">基本资料</a></dd>
                        <dd><a href="">安全设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item  logout"><a href="login.html">退出登录</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">用户信息管理</a>
                        <dl class="layui-nav-child">
                            <!-- <dd><a class="tea" href="javascript:;" url="teaInfo.html">教师信息</a></dd> -->
                            <dd><a href="javascript:;">学生信息</a></dd>


                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">题库管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;">题目管理</a></dd>
                            <dd><a href="javascript:;">科目管理</a></dd>
                            <dd><a href="javascript:;" class="menu" url="subjectadd.html">题目管理</a></dd>
                        </dl>
                    </li>
                    <!-- <li class="layui-nav-item"><a href="">用户信息管理</a></li>
                    <li class="layui-nav-item"><a href="">题库管理</a></li> -->
                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;" id="main"></div>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->

        </div>
    </div>

    <script type="text/javascript" src="layui-v2.5.7/layui/layui.js"></script>
    <script>
        //JavaScript代码区域
        layui.use(['element', 'jquery', 'layer'], function () {
            var element = layui.element;
            var $ = layui.jquery;
            var layer = layui.layer;

            $(".menu").click(function () {
                var url = $(this).attr("url");
                $.get(url, function (result) {
                    $("#main").html(result);
                })
            });


            $(".tea").click(function () {
                var url = $(this).attr("url");
                $.get(url, function (result) {
                    $("#main").html(result);
                })
            })

            $(".logout").click(function(){
                window.localStorage.getItem("student")=null;
                window.localStorage.getItem("token")=null
            })

            var s = window.localStorage.getItem("student");
            var stu= JSON.parse(s);
            $("#user").text(stu.stuName);

        });

    </script>
</body>



</body>

</html>